/** Simple RMI client program:

   The example show how to use RMI as two-way communication mechanism, and
broadcast message received from one client to all clients connected to the
server. The major differences between this example and MessageReceiver are

      - Make a remote client program as remote server so that server can
	call client's method.

*/

import java.rmi.*;

public interface MessageReceiver extends Remote {
    static String	serverName = "MessageReceiver";
    static int		REGISTRY_SUCCEED = 0, REGISTRY_FAIL = 1;

    // send a message from client/server to server/client.
    public void write(String clientName, String msg ) throws RemoteException;

    // Add a client to server's client holder.
    public int register( String s, MessageReceiver m) throws RemoteException;

    public void showMessage(String msg) throws RemoteException;
}
